package org.skipper.samples.dubbo.register.service;

import org.skipper.common.result.RpcResult;
import org.apache.dubbo.config.annotation.Service;
import org.skipper.samples.client.DemoService;
import org.skipper.samples.dto.DemoDTO;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author shoujian
 * Date: 2021-08-09
 * Time: 下午8:49
 */
@Service(registry = "defaultRegistry")
public class DefaultServiceImpl implements DemoService {
    @Override
    public RpcResult<DemoDTO> sayHello() {
        DemoDTO demoDTO = new DemoDTO();
        demoDTO.setId(1);
        demoDTO.setName("默认注册中心");
        demoDTO.setSay("必须指定registry，否则service会注册到所有registry");
        return RpcResult.createSuccessMsg(demoDTO);
    }
}
